/**
 * .ant-input-number 样式后期可删除
 * @param {string} type 按钮类型 ( text | textarea | number )
 * @param {string} disabled 按钮失效状态
 * @returns
 */

const Input = (argv: any) => {
    if (argv.type == 'textarea') {
        return (
            <textarea
                className={`ant-input ${argv.className}`}
                style={argv.style}
                rows={argv.rows}
                placeholder={argv.defaultValue}
                value={argv.value}
                onChange={argv.onChange}
                onEnded={argv.onEnded}
            />
        )
    } else {
        return (
            <input className={`ant-input ${argv.className}`} style={argv.style} placeholder={argv.defaultValue} type={argv.type} value={argv.value} onChange={argv.onChange} onEnded={argv.onEnded} />
        )
    }
}

Input.defaultProps = {
    type: 'text',
    rows: 3
}

export default Input
